package com.wits.qso.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import net.sf.json.JSONObject;

import com.wits.platform.entity.BaseEntity;

@Entity
@Table(name="qso_teacher")
public class Teacher extends BaseEntity {

	/**
	 * VersionUID
	 */
	private static final long serialVersionUID = -2376814867600304611L;

	/** 老师编号	 **/
	private String terId;	
	
	/** 老师姓名	 **/
	private String terName;	
	
	/** 老师性别	 **/
	private String terSex;	
	
	/** 老师电话	 **/
	private String terTel;	
	
	/** 老师邮箱	 **/
	private String terMail;	
	
	/** 登录账号	 **/
	private String terUserId;
	
	/**过期日期**/
	private Date dateExpire;
	

	
	@Id
	@GenericGenerator(name = "idGen", 
					strategy = "com.wits.platform.common.id.generator.IDGenerator",
					parameters={ 
								@Parameter(name = "segment_value", value = "QSO_TER_ID"), 
								@Parameter(name="table_name",value="wits_id_generator"),
								@Parameter(name="value_column_name",value="gen_value"),
								@Parameter(name="segment_column_name",value="gen_name"),
								@Parameter(name="segment_value_length",value="10"),
								@Parameter(name="sq_format",value="%08d"), 
								@Parameter(name="sq_prefix",value="TR") 
					})
	@GeneratedValue(generator = "idGen")
	@Column(name = "ter_id", nullable = false, insertable = true, updatable = false, length = 10)
	public String getTerId() {
		return terId;
	}

	public void setTerId(String terId) {
		this.terId = terId;
	}

	@Column(name="ter_name",length=100)
	public String getTerName() {
		return terName;
	}

	public void setTerName(String terName) {
		this.terName = terName;
	}

	@Column(name="ter_sex",length=2)
	public String getTerSex() {
		return terSex;
	}

	public void setTerSex(String terSex) {
		this.terSex = terSex;
	}

	@Column(name="ter_tel",length=100)
	public String getTerTel() {
		return terTel;
	}

	public void setTerTel(String terTel) {
		this.terTel = terTel;
	}

	@Column(name="ter_mail",length=100)
	public String getTerMail() {
		return terMail;
	}

	public void setTerMail(String terMail) {
		this.terMail = terMail;
	}
	
	@Column(name="ter_userid",length=50)
	public String getTerUserId() {
		return terUserId;
	}

	public void setTerUserId(String terUserId) {
		this.terUserId = terUserId;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "date_Expire")
	public Date getDateExpire() {
		return dateExpire;
	}

	public void setDateExpire(Date dateExpire) {
		this.dateExpire = dateExpire;
	}

	@Override
	public String display() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public String toString(){
		return JSONObject.fromObject(this, Teacher.getBaseJsonConfig()).toString();
	}
	
}
